home *** CD-ROM | disk | FTP | other *** search
- -- stack: in
- -- format: 8 (HyperCard 1)
- -- flags: 0x5000 (can't delete)
- -- protect password hash: 0
- -- maximum user level: 5 (scripting)
- -- window: Rect(x1=0, y1=0, x2=0, y2=0)
- -- screen: Rect(x1=0, y1=0, x2=0, y2=0)
- -- card dimensions: w=0 h=0
- -- scroll: x=0 y=0
- -- background count: 8
- -- first background id: 2800
- -- card count: 11
- -- first card id: 2878
- -- list block id: 5709
- -- print block id: 0
- -- font table block id: 0
- -- style table block id: 0
- -- free block count: 0
- -- free size: 0 bytes
- -- total size: 53120 bytes
- -- stack block size: 8192 bytes
- -- created by hypercard version: 0x00000000
- -- compacted by hypercard version: 0x01228000
- -- modified by hypercard version: 0x01228000
- -- opened by hypercard version: 0x01228000
- -- patterns[0]: 0x0000000000000000
- -- patterns[1]: 0x8000000008000000
- -- patterns[2]: 0x8800220088002200
- -- patterns[3]: 0x8888222288882222
- -- patterns[4]: 0x88AA22AA88AA22AA
- -- patterns[5]: 0xCCAA33AACCAA33AA
- -- patterns[6]: 0xEEAABBAAEEAABBAA
- -- patterns[7]: 0xEEBBBBEEEEBBBBEE
- -- patterns[8]: 0xFFBBFFEEFFBBFFEE
- -- patterns[9]: 0xFFBBFFFFFFBBFFFF
- -- patterns[10]: 0x8010022001084004
- -- patterns[11]: 0xFFFFFFFFFFFFFFFF
- -- patterns[12]: 0x8822882288228822
- -- patterns[13]: 0x1122448811224488
- -- patterns[14]: 0xC4800C6843023026
- -- patterns[15]: 0xB130031BD8C00C8D
- -- patterns[16]: 0xAA00AA00AA00AA00
- -- patterns[17]: 0x8822552288225522
- -- patterns[18]: 0x8855225588552255
- -- patterns[19]: 0x77DD77DD77DD77DD
- -- patterns[20]: 0x8000000000000000
- -- patterns[21]: 0xAA55AA55AA55AA55
- -- patterns[22]: 0x038448300C020101
- -- patterns[23]: 0x8244394482010101
- -- patterns[24]: 0x8814224188412214
- -- patterns[25]: 0x8080413E080814E3
- -- patterns[26]: 0x22048C7422179810
- -- patterns[27]: 0xBE808808EB088880
- -- patterns[28]: 0x25C8328964244C92
- -- patterns[29]: 0xA29C41BE2AC914EB
- -- patterns[30]: 0x40A00000040A0000
- -- patterns[31]: 0x8040200002040800
- -- patterns[32]: 0xAA00800088008000
- -- patterns[33]: 0xFF80808080808080
- -- patterns[34]: 0x081C22C180010204
- -- patterns[35]: 0xFF808080FF080808
- -- patterns[36]: 0xF87422478F172271
- -- patterns[37]: 0xBF00BFBFB0B0B0B0
- -- patterns[38]: 0xFF7FBE5DA2418000
- -- patterns[39]: 0xFAF5FAF5A050A050
- -- checksum: 0x0
- ----- HyperTalk script -----
- on openStack
- global runHilite, External_Error, StackName, menuVis, msgVis
- put "" into External_Error
- put false into runHilite
- put true into menuVis
- put false into msgVis
- put word two of the long name of this stack into tmp
- put length(tmp) into len
- put char 2 to (len-1) of tmp into StackName
- set lockscreen to true
- push card
- go to card "Add"
- send InitAdd
- go to card "Paste"
- send InitPaste
- pop card
- set lockscreen to false
- end openStack
-
- -- determine line hit for mouse down in field
- function Clickline
- if the style of the target is "scrolling" then
- put the scroll of the target into s
- else
- put zero into s
- end if
- return (trunc((s + (item two of the clickloc) - (item two of the rect of the target)) div the textheight of the target) + one)
- end Clickline
-
- -- should be simpler!
- function number_of_cards_of_this_background
- if the version >= 1.2 then
- return the number of cds of this bg
- end if
- set lockscreen to true
- put the name of this card into start
- put 1 into count
- go to next card of this background
- repeat while (the name of this card) <> start
- add 1 to count
- go to next card of this background
- end repeat
- set lockscreen to false
- return count
- end number_of_cards_of_this_background
-
- on AddCard type, name
- if type = "XCMD" then
- go to last card of background "Commands"
- else if type = "XFCN" then
- go to last card of background "Functions"
- else if type = "ICON" then
- go to last card of background "Icons"
- else if type = "CURS" then
- go to last card of background "Cursors"
- else if type = "snd " then
- go to last card of background "Sounds"
- else
- exit AddCard
- end if
- AddNewCard name
- end AddCard
-
- -- deleteCard & newCard, be fancy with next and prev buttons
- on deleteCard
- if number_of_cards_of_this_background() = 2 then
- set visible of background button "Next" to false
- set visible of background button "Prev" to false
- set visible of background button "Scan" to false
- else
- set visible of background button "Next" to true
- set visible of background button "Prev" to true
- set visible of background button "Scan" to true
- end if
- end deleteCard
-
- on newCard
- if number_of_cards_of_this_background() = 1 then
- set visible of background button "Next" to false
- set visible of background button "Prev" to false
- set visible of background button "Scan" to false
- else
- set visible of background button "Next" to true
- set visible of background button "Prev" to true
- set visible of background button "Scan" to true
- end if
- end newCard
-
- on doHilite
- global runHilite
-
- if runHilite and not (visible of msg) then
- highlight a
- end if
- put not runHilite into runHilite
- end doHilite
-
- on resetHighlight
- put "" into background field "HighlightAreas"
- end resetHighlight
-
- -- deleteRes & renameRes, used for "card" resources e.g. XCMDs
- on deleteRes assoc
- global External_Error, StackName
-
- if number_of_cards_of_this_background() = 1 then
- answer "Sorry, you can't delete the last" && background field "resType" with "OK"
- exit deleteRes
- else if (the version >= 1.2) then
- if (the cantDelete of this card) then
- answer "This resource is required by this stack!"
- exit deleteRes
- end if
- end if
-
- answer "PERMANENTLY delete" && background field "Name" & "?" with "Yes" or "No"
- if it = "Yes"
- then
- ResHandle "dele", StackName, background field "resType", background field "Name"
- if "ok" is in External_Error then
- if assoc <> "" then
- repeat while number of lines in assoc > 1 do
- put line 1 of assoc into rname
- delete line 1 of assoc
- put word 1 of rname into rtype
- delete word 1 of rname
- ResHandle "dele", StackName, rtype, rname
- end repeat
- end if
- put the name of next card of this background into dest
- doMenu "Delete Card"
- go to dest
- else
- answer "Delete failed:" && External_Error with "OK"
- end if
- end if
- end deleteRes
-
- on renameRes
- global External_Error, StackName
-
- if (the version >= 1.2) then
- if (the cantDelete of this card) then
- answer "This resource is required by this stack!"
- exit renameRes
- end if
- end if
-
- ask "Rename" && background field "Name" && "to?"
- put it into newname
- if newname <> "" then
- ResHandle "rena", StackName, background field "resType", background field "Name", newname
- if "ok" is in External_Error then
- put newname into background field "Name"
- else
- answer "Rename failed" with "OK"
- end if
- end if
-
- end renameRes
-
- -- used for "buttoned" resources e.g. icons
- on buttonHit
- if background field curButton <> "" then
- set the highlight of card button id (background field curButton) to false
- end if
- set the highlight of the target to true
- put the id of the target into background field curButton
- end buttonHit
-
- on butRename
- global External_Error, StackName
- if background field "curButton" = "" then
- answer "You must select something first!" with "Oops"
- exit butRename
- end if
- put the short name of button id (background field "curButton") into bname
- ask "Rename" && bname && "to?"
- put it into newname
- if newname <> "" then
- ResHandle "rena", StackName, background field "resType", bname, newname
- if "ok" is in External_Error then
- set the name of button id (background field "curButton") to newname
- else
- answer "Rename failed" with "OK"
- end if
- end if
- end butRename
-
- on butDelete
- global External_Error, StackName
- if background field "curButton" = "" then
- answer "You must select something first!" with "Oops"
- exit butDelete
- end if
-
- put the short name of button id (background field "curButton") into bname
- if bname = "" then
- answer "You must select a button first" with "Oops"
- exit butDelete
- end if
- if the optionKey is up
- then
- answer "PERMANENTLY delete" && bname & "?" with "Yes" or "No"
- if it = "No"
- then
- exit butDelete
- end if
- end if
-
- set lockscreen to true
- if the optionKey is up then
- ResHandle "dele", StackName, background field "resType", bname
- end if
- if the optionKey is down or "ok" is in External_Error then
- put the loc of button id (background field "curButton") into bloc
- put the number of button id (background field "curButton") into bnum
- put background field "Number"-1 into ix
- put ix into background field "Number"
- choose button tool
- click at bloc
- doMenu "Clear Button"
- choose browse tool
- if ix = 0 then
- if number_of_cards_of_this_background() > 1 then
- put the name of next card of this background into dest
- doMenu "Delete Card"
- go to dest
- else
- put "" into background field "curButton"
- resetHighlight
- end if
- else
- put the id of card button ix into background field "curButton"
- if ix >= bnum then -- not last button
- put ix into z
- repeat while z > bnum
- set the loc of button z to the loc of button (z-1)
- subtract 1 from z
- end repeat
- set the loc of button bnum to bloc
- end if
- end if
- else
- answer "Delete failed:" && External_Error with "OK"
- end if
- set lockscreen to false
-
- end butDelete
-
-